package vistas.estructuras;

import java.awt.Color;
import java.awt.Dimension;
import java.awt.Image;
import javax.swing.ImageIcon;

public class ContenedorEsquina extends Contenedor {
    Image imagen;
    Panel panel;
    
    public ContenedorEsquina() {
        super();
        setPreferredSize(new Dimension(25, 25));
        setBackground(new Color(128, 128, 128));
    }
    
    public void transparentarPanel() {
        try {
            Image imagenVehiculo = new ImageIcon(".\\src\\vistas\\estructuras\\imagenes\\Transparente.png").getImage();
            this.panel.setImagen(imagenVehiculo);
        } catch (Exception e) {
           System.out.println("Error en asignar imagen al panel!");
        }
    }
    
    public void colocarVehiculo(String tipoDeVehiculo) {
        if (this.panel == null) {
            this.panel = new Panel();
            this.panel.setPreferredSize(new Dimension(25, 25));
            this.add(panel);
        }
        
        try {
           Image imagenVehiculo = new ImageIcon(".\\src\\vistas\\estructuras\\imagenes\\Vehiculos\\" + tipoDeVehiculo + ".png").getImage();
           this.panel.setImagen(imagenVehiculo);
        } catch (Exception e) {
           System.out.println("Error en asignar imagen al panel!");
        }
    }
}